<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> Example </TITLE>

 </HEAD>

 <BODY>
 <pre>
  public static void main(String[] args) {
        try {
			DBFactory.loadDriver("D:/lib/java/jdbc/mysql-connector-java-5.1.10-bin.jar");
			DBFactory.setUrl("jdbc:mysql://127.0.0.1:3306/laweb");
			DBFactory.setDriver("com.mysql.jdbc.Driver");
			DBFactory.setUser("laweb");
			DBFactory.setPassword("laweb");
			DBExecutor db = DBFactory.build();
			RowSet rs = db.query("select * from country");
			DBFactory.destory();
			System.out.println(DBUtils.getDumpSql(rs));
		} catch (Exception e) {
			e.printStackTrace();
		}
    }
 </pre>
 
 	

Context initContext = new InitialContext();
Context envContext  = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
Connection conn = ds.getConnection();

jdbc.driverClassName=oracle.jdbc.OracleDriver
jdbc.url=jdbc:oracle:thin:@192.168.2.200:1521:qydb
jdbc.username=RDP
jdbc.password=PASSWORD

com.mysql.jdbc.Driver
jdbc:mysql://127.0.0.1:3306/cupmp

 </BODY>
</HTML>
